![]() |
![]() |
A miniport driver that supports 802.1Q can receive packets that contain priority and VLAN identifier (VLAN ID) values in their tag headers . Before indicating up such packets, the miniport driver should:
The miniport driver should set these values to the values of the priority and VLAN ID that it removed from the original packet.
The following table summarizes the actions that a miniport driver should perform on an 802.1Q receive packet:
Configured VLAN ID for the NIC | Packet Contains a Tag Header? | VLAN ID in the Tag Header | Miniport Driver Action |
---|---|---|---|
Zero | Yes | Any value | Remove priority and VLAN ID from the packet.
Insert removed priority and VLAN ID into per-packet information. Indicate the packet. |
Zero | No | Not applicable | Set the priority and VLAN ID in per-packet information to
zero.
Indicate the packet. |
Nonzero | Yes | Matches the configured VLAN ID | Remove priority and VLAN ID from the packet.
Insert removed priority and VLAN ID into per-packet information. Indicate the packet. |
Nonzero | Yes | Does not match the configured VLAN ID | Do not indicate the packet. |
Nonzero | No | Not applicable | Do not indicate the packet. |
Note If a receive packet's Ethernet header specifies a protocol type (EtherType) of 802.3ad or GARP VLAN Registration Protocol (GVRP), the miniport driver should indicate the packet without modifying it.
To insert priority and VLAN-identifier values into a packet descriptor, a miniport driver calls the NDIS_PER_PACKET_INFO_FROM_PACKET macro. In this call, the miniport driver passes:
In the following code sample, the pPacketDesc variable points to a packet, and the UserPriority and VlanID variables hold the priority and VLAN identifier values, respectively, to insert into the packet.
NDIS_PACKET_8021Q_INFO VlanPriInfo; UINT32 UserPriority = 1; UINT32 VlanID = 777; // Change this to correct value. VlanPriInfo.Value = // Get current value. NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, Ieee8021QInfo); VlanPriInfo.TagHeader.UserPriority = UserPriority; // Set priority. VlanPriInfo.TagHeader.VlanId = VlanID; // Set VLAN identifier. VlanPriInfo.TagHeader.CanonicalFormatId = 0; // Should be zero. VlanPriInfo.TagHeader.Reserved = 0; // Should be zero. NDIS_PER_PACKET_INFO_FROM_PACKET(pPacketDesc, Ieee8021QInfo) = VlanPriInfo.Value;